            <!-- right -->
            <div class="col-md-9">
            	
                <!-- Home banner -->
            	<?php $this->banners->show_collection(1, 9, 'home_banner');?>
                <!-- end home banner -->
                
                <div class="box_content">
                	<div class="title_head khuyendung_wp_title">
                    	<h3> Sản phẩm bán chạy</h3>
                        <div class="icon_like"><img src="<?php echo base_url(ASSETPATH.'images/icon_khuyendung_2.png')?>"></div>
                    </div>
                    <div class="home_product_wp">
						<ul class="box_product_ul">
                        	<?php $tmp_count = 1; foreach($products_banchay as $item){
								$array_slug = $item->category;
								if(count($array_slug)>=2)
									$slug = $array_slug[0]->slug."/".$array_slug[1]->slug;
								else
									$slug = $array_slug[0]->slug;	
							?>
                            <li class="box_product_li col-xs-12 col-sm-6 col-md-3">
                            	<div class="product_rank">
                                	<p><img src="<?php echo base_url(ASSETPATH.'images/rank_'.$tmp_count++.'.jpg');?>"></p>
                                </div>
								<div class="box_product_wp">
                                    <div class="product_image">
                                        <?php if(!empty($item->active_docquyen))echo '<div class="rolate_image">Độc quyền</div>'?>
                                    	<?php $photo  = theme_img('no_picture.png', lang('no_image_available'));
                        				$item->images    = array_values((array)json_decode($item->images));
                                    	if(!empty($item->images[0]))
                                        {
                                            $primary    = $item->images[0];
                                            foreach($item->images as $photo)
                                            {
                                                if(isset($photo->primary))
                                                {
                                                    $primary    = $photo;
                                                }
                                            }
                                            $photo  = '<img src="'.base_url('uploads/images/thumbnails/'.$primary->filename).'" alt="'.$item->seo_title.'"/>';
                                       }?>
                                    	<a href="<?php echo site_url($slug.'/'.$item->slug);?>"><?php echo $photo;?></a>
                                        <?php if($item->quantity <= 0)echo ' <div class="product_status"><div class="info_status_product">Sản phẩm đang về</div><div class="backgroup_opacity"></div></div>'?>
                                    </div>
                                    <div class="product_text">
                                    	<h3><a href="<?php echo site_url($slug.'/'.$item->slug);?>"><?php echo $item->name?></a></h3>
                                        <p><?php echo $item->excerpt?></p>
                                    </div>
                                    <div class="product_price">
                                    	<!--<p class="red">1.000.000 <span>VNĐ</span></p>-->
                                        
                                        <p class="red">
                                        		
											<?php 
												if(!empty($price_products_banchay[$item->id])){
													echo format_currency($price_products_banchay[$item->id]);
												}else{
												  if($item->saleprice > 0)
													echo format_currency($item->saleprice);
                                            	  else 
												  	echo format_currency($item->price);
												}?>
                                        </p>
                                        <div class="button_cart">
                                        	<?php echo form_open('cart/add_to_cart', 'class="form-horizontal"');?>
                                            <input type="hidden" name="cartkey" value="<?php echo $this->session->flashdata('cartkey');?>" />
                                            <input type="hidden" name="id" value="<?php echo $item->id?>"/>
                                             <?php if($item->quantity > 0){?><button class="button-shopping-cart" type="submit" value="submit"><i class="fa fa-shopping-cart"></i></button><?php }?>
                                            </form>
                                        </div>
                                    </div>
								</div>
							</li>
                            <?php }?>
							
						</ul>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="box_content">
                	<div class="title_head khuyendung_wp_title">
                    	<h3>sản phẩm khuyên dùng</h3>
                        <div class="icon_like"><img src="<?php echo base_url(ASSETPATH.'images/icon_khuyendung.png')?>"></div>
                    </div>
                    <div class="home_product_wp">
						<ul class="box_product_ul">
							<?php foreach($products_khuyendung as $item){?>
                            <li class="box_product_li col-xs-12 col-sm-6 col-md-3">                            	
								<div class="box_product_wp">
                                    <div class="product_image">
                                    	<?php if(!empty($item->active_docquyen))echo '<div class="rolate_image">Độc quyền</div>'?>
                                    	<?php $photo  = theme_img('no_picture.png', lang('no_image_available'));
                        				$item->images    = array_values((array)json_decode($item->images));
                                    	if(!empty($item->images[0])){
                                            $primary    = $item->images[0];
                                            foreach($item->images as $photo)
                                            {
                                                if(isset($photo->primary))
                                                {
                                                    $primary    = $photo;
                                                }
                                            }
                                            $photo  = '<img src="'.base_url('uploads/images/thumbnails/'.$primary->filename).'" alt="'.$item->seo_title.'"/>';
                                       }?>
                                    	<a href="<?php echo site_url($item->cat_slug.'/'.$item->slug);?>"><?php echo $photo;?></a>
                                         <?php if($item->quantity <= 0)echo '<div class="product_status"><div class="info_status_product">Sản phẩm đang về</div><div class="backgroup_opacity"></div></div>'?>
                                    </div>
                                    <div class="product_text">
                                    	<h3><a href="<?php echo site_url($item->cat_slug.'/'.$item->slug);?>"><?php echo $item->name?></a></h3>
                                        <p><?php echo $item->excerpt?></p>
                                    </div>
                                    <div class="product_price">
                                    	<!--<p class="red">1.000.000 <span>VNĐ</span></p>-->
                                        <p class="red">
											<?php 
												if(!empty($price_products_khuyendung[$item->id])){
													echo format_currency($price_products_khuyendung[$item->id]);
												}else{
												  if($item->saleprice > 0)
													echo format_currency($item->saleprice);
                                            	  else 
												  	echo format_currency($item->price);
												}?>
                                        </p>
                                        <div class="button_cart">
                                        	<?php echo form_open('cart/add_to_cart', 'class="form-horizontal"');?>
                                            <input type="hidden" name="cartkey" value="<?php echo $this->session->flashdata('cartkey');?>" />
                                            <input type="hidden" name="id" value="<?php echo $item->id?>"/>
                                             <?php if($item->quantity > 0){?><button class="button-shopping-cart" type="submit" value="submit"><i class="fa fa-shopping-cart"></i></button><?php }?>
                                            </form>
                                        </div>
                                    </div>
								</div>
							</li>
                            <?php }?>
						</ul>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="box_content">
                	<div class="title_head khuyendung_wp_title">
                    	<h3> sản phẩm chủ lực</h3>
                        <div class="icon_like"><img src="<?php echo base_url(ASSETPATH.'images/icon_khuyendung_1.png')?>"></div>
                    </div>
                    <div class="home_product_wp">
						<ul class="box_product_ul">
							<?php foreach($products_chuluc as $item){?>
                            <li class="box_product_li col-xs-12 col-sm-6 col-md-3">                            	
								<div class="box_product_wp">
                                    <div class="product_image">
                                    	<?php if(!empty($item->active_docquyen))echo '<div class="rolate_image">Độc quyền</div>'?>
                                    	<?php $photo  = theme_img('no_picture.png', lang('no_image_available'));
                        				$item->images    = array_values((array)json_decode($item->images));
                                    	if(!empty($item->images[0]))
                                        {
                                            $primary    = $item->images[0];
                                            foreach($item->images as $photo)
                                            {
                                                if(isset($photo->primary))
                                                {
                                                    $primary    = $photo;
                                                }
                                            }
                
                                            $photo  = '<img src="'.base_url('uploads/images/thumbnails/'.$primary->filename).'" alt="'.$item->seo_title.'"/>';
                                       }?>
                                    	<a href="<?php echo site_url($item->cat_slug.'/'.$item->slug);?>"><?php echo $photo;?></a>
                                         <?php if($item->quantity <= 0)echo ' <div class="product_status"><div class="info_status_product">Sản phẩm đang về</div><div class="backgroup_opacity"></div></div>'?>
                                    </div>
                                    <div class="product_text">
                                    	<h3><a href="<?php echo site_url($item->cat_slug.'/'.$item->slug);?>"><?php echo $item->name?></a></h3>
                                        <p><?php echo $item->excerpt?></p>
                                    </div>
                                    <div class="product_price">
                                    	<!--<p class="red">1.000.000 <span>VNĐ</span></p>-->
                                        <p class="red">
											<?php 
												if(!empty($price_products_chuluc[$item->id])){
													echo format_currency($price_products_chuluc[$item->id]);
												}else{
												  if($item->saleprice > 0)
													echo format_currency($item->saleprice);
                                            	  else 
												  	echo format_currency($item->price);
												}?>
                                        </p>
                                        <div class="button_cart">
                                        	<?php echo form_open('cart/add_to_cart', 'class="form-horizontal"');?>
                                            <input type="hidden" name="cartkey" value="<?php echo $this->session->flashdata('cartkey');?>" />
                                            <input type="hidden" name="id" value="<?php echo $item->id?>"/>
                                            <?php if($item->quantity > 0){?> <button class="button-shopping-cart" type="submit" value="submit"><i class="fa fa-shopping-cart"></i></button><?php }?>
                                            </form>
                                        </div>
                                    </div>
								</div>
							</li>
                            <?php }?>
						</ul>
                        <div class="clear"></div>
                    </div>
                </div>
                
                <!-- TIN TỨC KHUYẾN MÃI, CAMPAIGN -->
                <?php include ("box_promotion_campaign.php");?>                
                <!-- END TIN TỨC KHUYẾN MÃI, CAMPAIGN -->
                
                <!-- TIN TỨC plusmainichi-->
                <?php include ("box_promotion_plusmainichi.php");?>                
                <!-- END TIN plusmainichi-->
                
                <!-- VIDEO -->
                <?php $this->banners->show_collection(5, 10, 'video');?>
                <!-- END VIDEO -->
                
                <!-- BANNER FOOTER -->
                <?php //$this->banners->show_collection(3, 2, 'footer_banner');?>
                <!-- END BANNER FOOTER -->
            </div>
